package com.yupi.yuoj.judge.codesanbox;
import com.yupi.yuoj.judge.codesanbox.model.ExecuteCodeRequest;
import com.yupi.yuoj.judge.codesanbox.model.ExecuteCodeResponse;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class CodeSandProxy implements CodeSandbox{
    private final CodeSandbox codeSandbox;

    public CodeSandProxy(CodeSandbox codeSandbox) {
        this.codeSandbox = codeSandbox;
    }

    @Override
    public ExecuteCodeResponse executeCode(ExecuteCodeRequest executeCodeRequest) {
        log.info("代码沙箱请求信息: "+executeCodeRequest.toString());
        ExecuteCodeResponse executeCodeResponse = codeSandbox.executeCode(executeCodeRequest);
        log.info("代码沙箱响应信息: "+executeCodeResponse.toString());
        return  executeCodeResponse;
    }
}
